﻿int[] arr = { 7, 8, 9, 10, 11, 1, 2, 3, 4, 5, 6, 12 };
int len = 12;
int maxNum = arr[0];
int minNum = arr[0];
double aver = 0;
int sum = 0;

for (int i = 0; i < len; i++)
{
    sum += arr[i];
    if(arr[i] > maxNum)
        maxNum = arr[i];
    if(arr[i] < minNum)
        minNum  =  arr[i];
}
aver = sum * 1.0 / len ;
Console.WriteLine("该数组最大值为{0}，最小值为{1}，平均值为{2}，元素和为{3}",maxNum,minNum,aver,sum);
